Optimal. Leaf size=325 \[ -\frac {2 (e+f x) \tanh ^{-1}\left (e^{i (c+d x)}\right )}{a d}+\frac {i b (e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{a \sqrt {a^2-b^2} d}-\frac {i b (e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{a \sqrt {a^2-b^2} d}+\frac {i f \text {Li}_2\left (-e^{i (c+d x)}\right )}{a d^2}-\frac {i f \text {Li}_2\left (e^{i (c+d x)}\right )}{a d^2}+\frac {b f \text {Li}_2\left (\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{a \sqrt {a^2-b^2} d^2}-\frac {b f \text {Li}_2\left (\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{a \sqrt {a^2-b^2} d^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.36, antiderivative size = 325, normalized size of antiderivative = 1.00, number of steps
used = 14, number of rules used = 7, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.292, Rules used = {4631, 4268,
2317, 2438, 3404, 2296, 2221} \begin {gather*} \frac {b f \text {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{a d^2 \sqrt {a^2-b^2}}-\frac {b f \text {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{\sqrt {a^2-b^2}+a}\right )}{a d^2 \sqrt {a^2-b^2}}+\frac {i f \text {PolyLog}\left (2,-e^{i (c+d x)}\right )}{a d^2}-\frac {i f \text {PolyLog}\left (2,e^{i (c+d x)}\right )}{a d^2}+\frac {i b (e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{a d \sqrt {a^2-b^2}}-\frac {i b (e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{\sqrt {a^2-b^2}+a}\right )}{a d \sqrt {a^2-b^2}}-\frac {2 (e+f x) \tanh ^{-1}\left (e^{i (c+d x)}\right )}{a d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2221
Rule 2296
Rule 2317
Rule 2438
Rule 3404
Rule 4268
Rule 4631
Rubi steps
\begin {align*} \int \frac {(e+f x) \csc (c+d x)}{a+b \sin (c+d x)} \, dx &=\frac {\int (e+f x) \csc (c+d x) \, dx}{a}-\frac {b \int \frac {e+f x}{a+b \sin (c+d x)} \, dx}{a}\\ &=-\frac {2 (e+f x) \tanh ^{-1}\left (e^{i (c+d x)}\right )}{a d}-\frac {(2 b) \int \frac {e^{i (c+d x)} (e+f x)}{i b+2 a e^{i (c+d x)}-i b e^{2 i (c+d x)}} \, dx}{a}-\frac {f \int \log \left (1-e^{i (c+d x)}\right ) \, dx}{a d}+\frac {f \int \log \left (1+e^{i (c+d x)}\right ) \, dx}{a d}\\ &=-\frac {2 (e+f x) \tanh ^{-1}\left (e^{i (c+d x)}\right )}{a d}+\frac {\left (2 i b^2\right ) \int \frac {e^{i (c+d x)} (e+f x)}{2 a-2 \sqrt {a^2-b^2}-2 i b e^{i (c+d x)}} \, dx}{a \sqrt {a^2-b^2}}-\frac {\left (2 i b^2\right ) \int \frac {e^{i (c+d x)} (e+f x)}{2 a+2 \sqrt {a^2-b^2}-2 i b e^{i (c+d x)}} \, dx}{a \sqrt {a^2-b^2}}+\frac {(i f) \text {Subst}\left (\int \frac {\log (1-x)}{x} \, dx,x,e^{i (c+d x)}\right )}{a d^2}-\frac {(i f) \text {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^{i (c+d x)}\right )}{a d^2}\\ &=-\frac {2 (e+f x) \tanh ^{-1}\left (e^{i (c+d x)}\right )}{a d}+\frac {i b (e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{a \sqrt {a^2-b^2} d}-\frac {i b (e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{a \sqrt {a^2-b^2} d}+\frac {i f \text {Li}_2\left (-e^{i (c+d x)}\right )}{a d^2}-\frac {i f \text {Li}_2\left (e^{i (c+d x)}\right )}{a d^2}-\frac {(i b f) \int \log \left (1-\frac {2 i b e^{i (c+d x)}}{2 a-2 \sqrt {a^2-b^2}}\right ) \, dx}{a \sqrt {a^2-b^2} d}+\frac {(i b f) \int \log \left (1-\frac {2 i b e^{i (c+d x)}}{2 a+2 \sqrt {a^2-b^2}}\right ) \, dx}{a \sqrt {a^2-b^2} d}\\ &=-\frac {2 (e+f x) \tanh ^{-1}\left (e^{i (c+d x)}\right )}{a d}+\frac {i b (e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{a \sqrt {a^2-b^2} d}-\frac {i b (e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{a \sqrt {a^2-b^2} d}+\frac {i f \text {Li}_2\left (-e^{i (c+d x)}\right )}{a d^2}-\frac {i f \text {Li}_2\left (e^{i (c+d x)}\right )}{a d^2}-\frac {(b f) \text {Subst}\left (\int \frac {\log \left (1-\frac {2 i b x}{2 a-2 \sqrt {a^2-b^2}}\right )}{x} \, dx,x,e^{i (c+d x)}\right )}{a \sqrt {a^2-b^2} d^2}+\frac {(b f) \text {Subst}\left (\int \frac {\log \left (1-\frac {2 i b x}{2 a+2 \sqrt {a^2-b^2}}\right )}{x} \, dx,x,e^{i (c+d x)}\right )}{a \sqrt {a^2-b^2} d^2}\\ &=-\frac {2 (e+f x) \tanh ^{-1}\left (e^{i (c+d x)}\right )}{a d}+\frac {i b (e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{a \sqrt {a^2-b^2} d}-\frac {i b (e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{a \sqrt {a^2-b^2} d}+\frac {i f \text {Li}_2\left (-e^{i (c+d x)}\right )}{a d^2}-\frac {i f \text {Li}_2\left (e^{i (c+d x)}\right )}{a d^2}+\frac {b f \text {Li}_2\left (\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{a \sqrt {a^2-b^2} d^2}-\frac {b f \text {Li}_2\left (\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{a \sqrt {a^2-b^2} d^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(764\) vs. \(2(325)=650\).
time = 3.88, size = 764, normalized size = 2.35 \begin {gather*} \frac {d e \log \left (\tan \left (\frac {1}{2} (c+d x)\right )\right )-c f \log \left (\tan \left (\frac {1}{2} (c+d x)\right )\right )+f \left ((c+d x) \left (\log \left (1-e^{i (c+d x)}\right )-\log \left (1+e^{i (c+d x)}\right )\right )+i \left (\text {Li}_2\left (-e^{i (c+d x)}\right )-\text {Li}_2\left (e^{i (c+d x)}\right )\right )\right )-\frac {b d (e+f x) \left (\frac {2 (d e-c f) \tan ^{-1}\left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}-\frac {i f \left (\log \left (1-i \tan \left (\frac {1}{2} (c+d x)\right )\right ) \log \left (\frac {b+\sqrt {-a^2+b^2}+a \tan \left (\frac {1}{2} (c+d x)\right )}{-i a+b+\sqrt {-a^2+b^2}}\right )+\text {Li}_2\left (\frac {a \left (1-i \tan \left (\frac {1}{2} (c+d x)\right )\right )}{a+i \left (b+\sqrt {-a^2+b^2}\right )}\right )\right )}{\sqrt {-a^2+b^2}}+\frac {i f \left (\log \left (1+i \tan \left (\frac {1}{2} (c+d x)\right )\right ) \log \left (\frac {b+\sqrt {-a^2+b^2}+a \tan \left (\frac {1}{2} (c+d x)\right )}{i a+b+\sqrt {-a^2+b^2}}\right )+\text {Li}_2\left (\frac {a \left (1+i \tan \left (\frac {1}{2} (c+d x)\right )\right )}{a-i \left (b+\sqrt {-a^2+b^2}\right )}\right )\right )}{\sqrt {-a^2+b^2}}+\frac {i f \left (\log \left (1-i \tan \left (\frac {1}{2} (c+d x)\right )\right ) \log \left (\frac {-b+\sqrt {-a^2+b^2}-a \tan \left (\frac {1}{2} (c+d x)\right )}{i a-b+\sqrt {-a^2+b^2}}\right )+\text {Li}_2\left (\frac {a \left (i+\tan \left (\frac {1}{2} (c+d x)\right )\right )}{i a-b+\sqrt {-a^2+b^2}}\right )\right )}{\sqrt {-a^2+b^2}}-\frac {i f \left (\log \left (1+i \tan \left (\frac {1}{2} (c+d x)\right )\right ) \log \left (\frac {b-\sqrt {-a^2+b^2}+a \tan \left (\frac {1}{2} (c+d x)\right )}{i a+b-\sqrt {-a^2+b^2}}\right )+\text {Li}_2\left (\frac {a+i a \tan \left (\frac {1}{2} (c+d x)\right )}{a+i \left (-b+\sqrt {-a^2+b^2}\right )}\right )\right )}{\sqrt {-a^2+b^2}}\right )}{d e-c f+i f \log \left (1-i \tan \left (\frac {1}{2} (c+d x)\right )\right )-i f \log \left (1+i \tan \left (\frac {1}{2} (c+d x)\right )\right )}}{a d^2} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 659 vs. \(2 (287 ) = 574\).
time = 0.15, size = 660, normalized size = 2.03
method | result | size |
risch | \(-\frac {2 i e b \arctan \left (\frac {2 i b \,{\mathrm e}^{i \left (d x +c \right )}-2 a}{2 \sqrt {-a^{2}+b^{2}}}\right )}{d a \sqrt {-a^{2}+b^{2}}}-\frac {f c \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d^{2} a}+\frac {i f \dilog \left ({\mathrm e}^{i \left (d x +c \right )}\right )}{d^{2} a}+\frac {e \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d a}-\frac {e \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d a}-\frac {f b \ln \left (\frac {i a +b \,{\mathrm e}^{i \left (d x +c \right )}-\sqrt {-a^{2}+b^{2}}}{i a -\sqrt {-a^{2}+b^{2}}}\right ) x}{d a \sqrt {-a^{2}+b^{2}}}-\frac {f b \ln \left (\frac {i a +b \,{\mathrm e}^{i \left (d x +c \right )}-\sqrt {-a^{2}+b^{2}}}{i a -\sqrt {-a^{2}+b^{2}}}\right ) c}{d^{2} a \sqrt {-a^{2}+b^{2}}}+\frac {f b \ln \left (\frac {i a +b \,{\mathrm e}^{i \left (d x +c \right )}+\sqrt {-a^{2}+b^{2}}}{i a +\sqrt {-a^{2}+b^{2}}}\right ) x}{d a \sqrt {-a^{2}+b^{2}}}+\frac {f b \ln \left (\frac {i a +b \,{\mathrm e}^{i \left (d x +c \right )}+\sqrt {-a^{2}+b^{2}}}{i a +\sqrt {-a^{2}+b^{2}}}\right ) c}{d^{2} a \sqrt {-a^{2}+b^{2}}}+\frac {i f b \dilog \left (\frac {i a +b \,{\mathrm e}^{i \left (d x +c \right )}-\sqrt {-a^{2}+b^{2}}}{i a -\sqrt {-a^{2}+b^{2}}}\right )}{d^{2} a \sqrt {-a^{2}+b^{2}}}-\frac {i f b \dilog \left (\frac {i a +b \,{\mathrm e}^{i \left (d x +c \right )}+\sqrt {-a^{2}+b^{2}}}{i a +\sqrt {-a^{2}+b^{2}}}\right )}{d^{2} a \sqrt {-a^{2}+b^{2}}}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) f x}{d a}+\frac {i f \dilog \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d^{2} a}+\frac {2 i f c b \arctan \left (\frac {2 i b \,{\mathrm e}^{i \left (d x +c \right )}-2 a}{2 \sqrt {-a^{2}+b^{2}}}\right )}{d^{2} a \sqrt {-a^{2}+b^{2}}}\) | \(660\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 1438 vs. \(2 (278) = 556\).
time = 0.64, size = 1438, normalized size = 4.42 \begin {gather*} \frac {-i \, b^{2} f \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} {\rm Li}_2\left (\frac {i \, a \cos \left (d x + c\right ) - a \sin \left (d x + c\right ) + {\left (b \cos \left (d x + c\right ) + i \, b \sin \left (d x + c\right )\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} - b}{b} + 1\right ) + i \, b^{2} f \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} {\rm Li}_2\left (\frac {i \, a \cos \left (d x + c\right ) - a \sin \left (d x + c\right ) - {\left (b \cos \left (d x + c\right ) + i \, b \sin \left (d x + c\right )\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} - b}{b} + 1\right ) + i \, b^{2} f \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} {\rm Li}_2\left (\frac {-i \, a \cos \left (d x + c\right ) - a \sin \left (d x + c\right ) + {\left (b \cos \left (d x + c\right ) - i \, b \sin \left (d x + c\right )\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} - b}{b} + 1\right ) - i \, b^{2} f \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} {\rm Li}_2\left (\frac {-i \, a \cos \left (d x + c\right ) - a \sin \left (d x + c\right ) - {\left (b \cos \left (d x + c\right ) - i \, b \sin \left (d x + c\right )\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} - b}{b} + 1\right ) - i \, {\left (a^{2} - b^{2}\right )} f {\rm Li}_2\left (\cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) + i \, {\left (a^{2} - b^{2}\right )} f {\rm Li}_2\left (\cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) - i \, {\left (a^{2} - b^{2}\right )} f {\rm Li}_2\left (-\cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) + i \, {\left (a^{2} - b^{2}\right )} f {\rm Li}_2\left (-\cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) + {\left (b^{2} c f - b^{2} d e\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} \log \left (2 \, b \cos \left (d x + c\right ) + 2 i \, b \sin \left (d x + c\right ) + 2 \, b \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} + 2 i \, a\right ) + {\left (b^{2} c f - b^{2} d e\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} \log \left (2 \, b \cos \left (d x + c\right ) - 2 i \, b \sin \left (d x + c\right ) + 2 \, b \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} - 2 i \, a\right ) - {\left (b^{2} c f - b^{2} d e\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} \log \left (-2 \, b \cos \left (d x + c\right ) + 2 i \, b \sin \left (d x + c\right ) + 2 \, b \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} + 2 i \, a\right ) - {\left (b^{2} c f - b^{2} d e\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} \log \left (-2 \, b \cos \left (d x + c\right ) - 2 i \, b \sin \left (d x + c\right ) + 2 \, b \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} - 2 i \, a\right ) + {\left (b^{2} d f x + b^{2} c f\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} \log \left (-\frac {i \, a \cos \left (d x + c\right ) - a \sin \left (d x + c\right ) + {\left (b \cos \left (d x + c\right ) + i \, b \sin \left (d x + c\right )\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} - b}{b}\right ) - {\left (b^{2} d f x + b^{2} c f\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} \log \left (-\frac {i \, a \cos \left (d x + c\right ) - a \sin \left (d x + c\right ) - {\left (b \cos \left (d x + c\right ) + i \, b \sin \left (d x + c\right )\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} - b}{b}\right ) + {\left (b^{2} d f x + b^{2} c f\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} \log \left (-\frac {-i \, a \cos \left (d x + c\right ) - a \sin \left (d x + c\right ) + {\left (b \cos \left (d x + c\right ) - i \, b \sin \left (d x + c\right )\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} - b}{b}\right ) - {\left (b^{2} d f x + b^{2} c f\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} \log \left (-\frac {-i \, a \cos \left (d x + c\right ) - a \sin \left (d x + c\right ) - {\left (b \cos \left (d x + c\right ) - i \, b \sin \left (d x + c\right )\right )} \sqrt {-\frac {a^{2} - b^{2}}{b^{2}}} - b}{b}\right ) - {\left ({\left (a^{2} - b^{2}\right )} d f x + {\left (a^{2} - b^{2}\right )} d e\right )} \log \left (\cos \left (d x + c\right ) + i \, \sin \left (d x + c\right ) + 1\right ) - {\left ({\left (a^{2} - b^{2}\right )} d f x + {\left (a^{2} - b^{2}\right )} d e\right )} \log \left (\cos \left (d x + c\right ) - i \, \sin \left (d x + c\right ) + 1\right ) - {\left ({\left (a^{2} - b^{2}\right )} c f - {\left (a^{2} - b^{2}\right )} d e\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2} i \, \sin \left (d x + c\right ) + \frac {1}{2}\right ) - {\left ({\left (a^{2} - b^{2}\right )} c f - {\left (a^{2} - b^{2}\right )} d e\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) - \frac {1}{2} i \, \sin \left (d x + c\right ) + \frac {1}{2}\right ) + {\left ({\left (a^{2} - b^{2}\right )} d f x + {\left (a^{2} - b^{2}\right )} c f\right )} \log \left (-\cos \left (d x + c\right ) + i \, \sin \left (d x + c\right ) + 1\right ) + {\left ({\left (a^{2} - b^{2}\right )} d f x + {\left (a^{2} - b^{2}\right )} c f\right )} \log \left (-\cos \left (d x + c\right ) - i \, \sin \left (d x + c\right ) + 1\right )}{2 \, {\left (a^{3} - a b^{2}\right )} d^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (e + f x\right ) \csc {\left (c + d x \right )}}{a + b \sin {\left (c + d x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F(-1)]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \text {Hanged} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________